﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace IteratorPattern
{
    class Waitress
    {

        public Waitress()
        {

        }
        public void PrintMenu()
        {
            PancakeHouseMenu pancakeHouseMenu = new PancakeHouseMenu();
            ArrayList breakfastItems = pancakeHouseMenu.GetMenuItems();

            foreach(MenuItem item in breakfastItems)
            {
                Console.WriteLine(item.GetName() + " ");
                Console.WriteLine(item.GetPrice() + " ");
                Console.WriteLine(item.GetDescription() + " ");
            }

            DinnerMenu dinerMenu = new DinnerMenu();
            MenuItem[] lunchItems = dinerMenu.GetMenuItems();
            //for(int i = 0; i < lunchItems.Length && lunchItems[i] != null; i ++)
            //{
            //    Console.WriteLine(lunchItems[i].GetName() + " ");
            //    Console.WriteLine(lunchItems[i].GetPrice() + " ");
            //    Console.WriteLine(lunchItems[i].GetDescription() + " ");
            //}
            foreach(var item in lunchItems)
            {
                if (item != null)
                {
                    Console.WriteLine(item.GetName() + " ");
                    Console.WriteLine(item.GetPrice() + " ");
                    Console.WriteLine(item.GetDescription() + " ");
                }
            }


        }
    }
}
